package com.masterclient.app.businessmodule.homemodule.view.adapter.diamond;

import android.graphics.Color;
import android.support.annotation.Nullable;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.eoner.baselibrary.utils.GlideUtil;
import com.eoner.baselibrary.utils.ScreenUtils;
import com.eoner.baselibrary.utils.UtilCollection;
import com.eoner.commonbean.banner.BannerNewItemBean;
import com.masterclient.app.R;

import java.util.List;

public class DiamondZoneAdapter  extends BaseQuickAdapter<BannerNewItemBean, BaseViewHolder> {


    public DiamondZoneAdapter(@Nullable List<BannerNewItemBean> data, int height) {
        super(R.layout.item_diamond_zone, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, BannerNewItemBean item) {
        ImageView iv = helper.getView(R.id.item_diamond_zone_logo);
        TextView tv = helper.getView(R.id.item_diamond_zone_text);
        tv.setText(item.getTitle());
        if(UtilCollection.isColor(item.getFont_color())){
            tv.setTextColor(Color.parseColor(item.getFont_color()));
        }else{
            tv.setTextColor(Color.parseColor("#333333"));
        }
        GlideUtil.displayImage(mContext,item.getImage(),iv,R.mipmap.defaults,ScreenUtils.dp2px(23),ScreenUtils.dp2px(23));
    }
}
